-
Notifications
You must be signed in to change notification settings - Fork 4
Add autoMapStreetLanes function to RoadNetwork class
#289
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #289 +/- ##
==========================================
+ Coverage 91.36% 91.39% +0.03%
==========================================
Files 38 38
Lines 5270 5370 +100
Branches 459 467 +8
==========================================
+ Hits 4815 4908 +93
- Misses 455 462 +7
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
src/dsm/sources/RoadNetwork.cpp
Outdated
| std::for_each(outNeighbours.cbegin(), | ||
| outNeighbours.cend(), | ||
| [this, &pair, &angle, &allowedTurns](auto const& outNodeId) { | ||
| auto const& pOutStreet{ |
Check notice
Code scanning / Cppcheck (reported by Codacy)
MISRA 12.3 rule Note
src/dsm/sources/RoadNetwork.cpp
Outdated
| allowedTurns.emplace(Direction::LEFT); | ||
| } | ||
| } | ||
| }); |
Check notice
Code scanning / Cppcheck (reported by Codacy)
MISRA 12.1 rule Note
src/dsm/sources/RoadNetwork.cpp
Outdated
| } | ||
| }); | ||
| auto const nLanes{pInStreet->nLanes()}; | ||
| std::vector<Direction> newMapping(nLanes, Direction::STRAIGHT); |
Check notice
Code scanning / Cppcheck (reported by Codacy)
MISRA 12.1 rule Note
| auto const nLanes{pInStreet->nLanes()}; | ||
| std::vector<Direction> newMapping(nLanes, Direction::STRAIGHT); | ||
| switch (nLanes) { | ||
| case 1: |
Check notice
Code scanning / Cppcheck (reported by Codacy)
MISRA 12.1 rule Note
| m_laneMapping = laneMapping; | ||
| std::string strLaneMapping; | ||
| std::for_each( | ||
| laneMapping.cbegin(), laneMapping.cend(), [&strLaneMapping](auto const item) { |
Check notice
Code scanning / Cppcheck (reported by Codacy)
MISRA 13.1 rule Note
| std::for_each( | ||
| outNeighbours.cbegin(), | ||
| outNeighbours.cend(), | ||
| [this, &pair, &pInStreet, &allowedTurns](auto const& outNodeId) { |
Check notice
Code scanning / Cppcheck (reported by Codacy)
MISRA 12.3 rule Note
| if (deltaAngle < -std::numbers::pi / 6.) { | ||
| Logger::debug( | ||
| std::format("Street {} can turn RIGHT", pInStreet->id())); | ||
| allowedTurns.emplace(Direction::RIGHT); |
Check notice
Code scanning / Cppcheck (reported by Codacy)
MISRA 17.7 rule Note
| } else if (deltaAngle > std::numbers::pi / 6.) { | ||
| Logger::debug( | ||
| std::format("Street {} can turn LEFT", pInStreet->id())); | ||
| allowedTurns.emplace(Direction::LEFT); |
Check notice
Code scanning / Cppcheck (reported by Codacy)
MISRA 17.7 rule Note
| } else { | ||
| Logger::debug( | ||
| std::format("Street {} can go STRAIGHT", pInStreet->id())); | ||
| allowedTurns.emplace(Direction::STRAIGHT); |
Check notice
Code scanning / Cppcheck (reported by Codacy)
MISRA 17.7 rule Note
| }); | ||
| auto const nLanes{pInStreet->nLanes()}; | ||
| while (allowedTurns.size() < static_cast<size_t>(nLanes)) { | ||
| if (allowedTurns.contains(Direction::STRAIGHT)) { |
Check notice
Code scanning / Cppcheck (reported by Codacy)
MISRA 14.4 rule Note
| graph.addNode(2, std::make_pair(-1., 0.)); | ||
| graph.addNode(3, std::make_pair(1., 1.)); | ||
| graph.addEdge<Street>(1, std::make_pair(0, 1), 1., 1., 3); | ||
| graph.addEdge<Street>(4, std::make_pair(1, 0), 1., 1., 3); |
Check notice
Code scanning / Cppcheck (reported by Codacy)
MISRA 12.3 rule Note test
| graph.addNode(3, std::make_pair(1., 1.)); | ||
| graph.addEdge<Street>(1, std::make_pair(0, 1), 1., 1., 3); | ||
| graph.addEdge<Street>(4, std::make_pair(1, 0), 1., 1., 3); | ||
| graph.addEdge<Street>(2, std::make_pair(0, 2), 1.); |
Check notice
Code scanning / Cppcheck (reported by Codacy)
MISRA 12.3 rule Note test
| graph.addEdge<Street>(1, std::make_pair(0, 1), 1., 1., 3); | ||
| graph.addEdge<Street>(4, std::make_pair(1, 0), 1., 1., 3); | ||
| graph.addEdge<Street>(2, std::make_pair(0, 2), 1.); | ||
| graph.addEdge<Street>(8, std::make_pair(2, 0), 1.); |
Check notice
Code scanning / Cppcheck (reported by Codacy)
MISRA 12.3 rule Note test
| graph.addEdge<Street>(4, std::make_pair(1, 0), 1., 1., 3); | ||
| graph.addEdge<Street>(2, std::make_pair(0, 2), 1.); | ||
| graph.addEdge<Street>(8, std::make_pair(2, 0), 1.); | ||
| graph.addEdge<Street>(3, std::make_pair(0, 3), 1., 1., 2); |
Check notice
Code scanning / Cppcheck (reported by Codacy)
MISRA 12.3 rule Note test
| graph.addEdge<Street>(2, std::make_pair(0, 2), 1.); | ||
| graph.addEdge<Street>(8, std::make_pair(2, 0), 1.); | ||
| graph.addEdge<Street>(3, std::make_pair(0, 3), 1., 1., 2); | ||
| graph.addEdge<Street>(12, std::make_pair(3, 0), 1., 1., 2); |
Check notice
Code scanning / Cppcheck (reported by Codacy)
MISRA 12.3 rule Note test
autoStreetLaneMappingfunction toRoadNetworkclass #287